using FytSoa.Domain.Core.Result;
using System.Threading.Tasks;
using FytSoa.Domain.Core.Param;

namespace FytSoa.Application.Sys;

/// <summary>
/// 授权表服务接口
/// </summary>
public interface ISysAuthorityService:IApplicationService
{
    /// <summary>
    /// 根据角色获得权限
    /// </summary>
    /// <returns></returns>
    Task<ApiResult<List<SysAuthorityDto>>> GetByRoleAsync(long roleId);

    /// <summary>
    /// 根据用户获得授权的角色
    /// </summary>
    /// <returns></returns>
    Task<ApiResult<List<string>>> GetByAdminAsync(long adminId);

    /// <summary>
    /// 为用户授权多个角色
    /// </summary>
    /// <returns></returns>
    Task<ApiResult<bool>> AddRoleAsync(SysAuthorityAdminByRoleParam param);

    /// <summary>
    /// 保存权限信息
    /// </summary>
    /// <returns></returns>
    Task<ApiResult<bool>> AddAsync(SysAuthorityParam authorityMenu);
}

